<template>
  <div style="padding: 0 10px">
    <div class="fw-bold c-5e5e5e">
      {{ Q["xh"] }}、
      <vue-mathjax :formula="Q['nr']" :safe="false"></vue-mathjax>
    </div>
    <div class="mt-14" style="max-width: 800px" v-if="Q['pic'][0]">
      <!-- <img v-if="Q['pic'].length==1" class="w100" v-lazy="Q['pic'][0]" /> -->
	  <img v-if="Q['pic'].length>0" class="w100" v-for="(img,index) in Q['pic']" v-lazy="img" />
    </div>
    <div class="mt-20">
      <Input
        v-model="Q.yx_da"
        type="textarea"
        :autosize="{ minRows: 6, maxRows: 6 }"
        placeholder="输入你的答案"
      />
    </div>
    <div class="choose-info mt-20 clearfix">
      <div class="float-right fz12 c-a5a5a5">
        <div
          v-if="this.$route.params.st_lx != '5'"
          class="inline-block cursor-pointer"
        >
          <p v-if="Q['collect_zt'] === 1" @click="collect_Q(0)">
            <span class="icon fa fa-star mr-4 c-ff9800 fz14 align-0"></span
            >已收藏
          </p>
          <p v-else @click="collect_Q(1)">
            <span class="icon fa fa-star mr-4 fz14 align-0"></span>收藏
          </p>
        </div>
        <!--<p class="cursor-pointer inline-block Q-fix-wrong ml-22">-->
        <!--<span class=" md  fz14" style="vertical-align: -2.5px;">highlight_off</span>-->
        <!--纠错-->
        <!--</p>-->
      </div>
    </div>
  </div>
</template>

<script>
import listmixins from "../listmixins";

export default {
  mixins: [listmixins],
  props: {
    Q: {
      type: Object,
      required: true,
    },
    request_id: {
      type: String,
    },
    colectId: {
      type: String,
    },
    bXlId: {
      type: String,
    },
    startRun: {
      type: Number,
    },
  },
  data() {
    return {
      letter_json: window.$plus.letter_caps,
    };
  },
  methods: {
    collect_Q(zt) {
      const Q = this.Q;
      this.$api.paper
        .collect_Q({
          token: this.$store.state.$user.token,
          lb_id: this.$route.params.product_id,
          sj_id: Q.sj_id,
          st_id: Q.id,
          lx: "collect",
          zt,
          request_id: this.request_id,
        })
        .then((rst) => {
          if (rst.data.event === "100") {
            Q["collect_zt"] = zt;
          } else {
            this.$Modal.info({ title: "提示", content: rst.data.msg });
          }
        });
    },
  },
};
</script>

<style scoped lang="scss">
//修复错误
.Q-fix-wrong:hover {
  color: #f64c0f;
}
</style>
